﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraTab;
    using Microsoft.VisualBasic;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    
    using Common.Report;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    using HRM.CORE.Process;
    using HRM.CORE.REPORT;
    
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Common.Environment;

    public class xucSalaryCard : Common.xucBase
    {
        private Bar bar1;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarSubItem barSubItem1;
        private BarButtonItem bbiPrint;
        private BarButtonItem bbiPrintAdvance;
        private BarButtonItem bbiPrintAllowance;
        private BarButtonItem bbiPrintAssignment;
        private BarButtonItem bbiPrintSalaryMinus;
        private BarButtonItem bbiPrintSalaryPay;
        private BarButtonItem bbiPrintSalaryPLus;
        private BarButtonItem bbiSave;
        private BarButtonItem bbiSendMail;
        private CalcEdit calAdvance;
        private CalcEdit calAllowance;
        private CalcEdit calBasicSalary;
        private CalcEdit calCoefficientSalary;
        private CalcEdit calHealthInsurance;
        private CalcEdit calIncomeTaxMoney;
        private CalcEdit calMinusMoney;
        private CalcEdit calSalary;
        private CalcEdit calSalaryDebt;
        private CalcEdit calSalaryPay;
        private CalcEdit calSocialInsurance;
        private CalcEdit calUnemploymentInsurance;
        private CalcEdit calWorkSalary;
        private IContainer components = null;
        private GroupBox groupBox1;
        private GroupBox grSalary;
        public DevExpress.Utils.ImageCollection imageCollection2;
        private PictureEdit imgPhoto;
        private HRM_EMPLOYEE l_Employee = new HRM_EMPLOYEE();
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl lcAdvance;
        private LabelControl lcAllowance;
        private LabelControl lcBasicSalary;
        private LabelControl lcCoefficientSalary;
        private LabelControl lcEmployee;
        private LabelControl lcIncomeTaxMoney;
        private LabelControl lcInsurance;
        private LabelControl lcMinusMoney;
        private LabelControl lcTotalSalary;
        private LabelControl lcWorkHour;
        private string m_EmployeeCode;
        private int m_Month;
        private Guid m_SalaryTableListID = Guid.Empty;
        private int m_Year;
        private XtraTabPage tabAdvance;
        private XtraTabPage tabAllowance;
        private XtraTabPage tabAssignment;
        private XtraTabPage tabMain;
        private XtraTabPage tabSalaryMinus;
        private XtraTabPage tabSalaryPay;
        private XtraTabPage tabSalaryPlus;
        private TextEdit txtID;
        private TextEdit txtName;
        private TextEdit txtWorkHour;
        private XtraTabControl xtraTabControl1;
        private xucAdvance1 xucAdvance;
        private xucAllowance1 xucAllowance;
        private xucAssignment1 xucAssignment;
        private HRM.CORE.xucSalaryMinus xucSalaryMinus;
        private xucSalaryPay1 xucSalaryPay;
        private HRM.CORE.xucSalaryPlus xucSalaryPlus;

        public event UpdatedHandler Updated;

        public xucSalaryCard()
        {
            this.InitializeComponent();
            this.InitMultiLanguages();
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            xfmReport report = new xfmReport();
            rptSalary2 xtraReport = new rptSalary2(this.m_Month, this.m_Year, this.m_EmployeeCode);
            report.SetTitle("Phiếu Lương Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
            report.ShowPrintPreview(xtraReport);
        }

        private void bbiPrintAdvance_ItemClick(object sender, ItemClickEventArgs e)
        {
            xfmReport report = new xfmReport();
            rptListAdvanceByEmployee xtraReport = new rptListAdvanceByEmployee(this.m_EmployeeCode, new System.DateTime(this.m_Year, this.m_Month, 1), DateAndTime.DateAdd(DateInterval.Day, -1.0, new System.DateTime(this.m_Year, this.m_Month + 1, 1)));
            report.SetTitle("Bảng Tạm Ứng Lương Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
            report.ShowPrintPreview(xtraReport);
        }

        private void bbiPrintAllowance_ItemClick(object sender, ItemClickEventArgs e)
        {
            xfmReport report = new xfmReport();
            rptAllowanceSalary xtraReport = new rptAllowanceSalary(this.m_Month, this.m_Year, this.m_EmployeeCode);
            report.SetTitle("Bảng Lương Phụ Cấp Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
            report.ShowPrintPreview(xtraReport);
        }

        private void bbiPrintAssignment_ItemClick(object sender, ItemClickEventArgs e)
        {
            xfmReport report = new xfmReport();
            rptListAssignmentByEmployee xtraReport = new rptListAssignmentByEmployee(this.m_EmployeeCode, new System.DateTime(this.m_Year, this.m_Month, 1), DateAndTime.DateAdd(DateInterval.Day, -1.0, new System.DateTime(this.m_Year, this.m_Month + 1, 1)));
            report.SetTitle("Bảng C\x00f4ng T\x00e1c Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
            report.ShowPrintPreview(xtraReport);
        }

        private void bbiPrintSalaryMinus_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        private void bbiPrintSalaryPay_ItemClick(object sender, ItemClickEventArgs e)
        {
            xfmReport report = new xfmReport();
            rptSalaryPay1 xtraReport = new rptSalaryPay1(this.m_SalaryTableListID, this.m_EmployeeCode);
            report.SetTitle("Phiếu Thanh To\x00e1n Lương Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString());
            report.ShowPrintPreview(xtraReport);
        }

        private void bbiPrintSalaryPLus_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        private void bbiSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            base.SetWaitDialogCaption("Đang lưu dữ liệu...");
            if (this.xucAllowance != null)
            {
                this.xucAllowance.Save();
            }
            if (this.xucAdvance != null)
            {
                this.xucAdvance.Save();
            }
            if (this.xucSalaryPay != null)
            {
                this.xucSalaryPay.Save();
            }
            if (this.xucAssignment != null)
            {
                this.xucAssignment.Save();
            }
            if (this.xucSalaryPlus != null)
            {
                this.xucSalaryPlus.Save();
            }
            if (this.xucSalaryMinus != null)
            {
                this.xucSalaryMinus.Save();
            }
            this.SetData(this.m_SalaryTableListID, this.m_EmployeeCode, this.m_Month, this.m_Year);
            this.RaiseUpdatedHander();
            this.DoHide();
        }

        private void bbiSendMail_ItemClick(object sender, ItemClickEventArgs e)
        {
            SendReportMail.LoginSuccessHander hander = null;
            SendReportMail.SendHander hander2 = null;
            if (WinInet.IsConnectedToInternet())
            {
                SendReportMail mail = new SendReportMail();
                if (!mail.IsLoginMail())
                {
                    if (hander == null)
                    {
                        hander = s => this.SendMail("", true);
                    }
                    mail.LoginSuccessed += hander;
                    if (hander2 == null)
                    {
                        hander2 = (s, content, attach) => this.SendMail(content, attach);
                    }
                    mail.Sended += hander2;
                    mail.LoginMail(2);
                }
                else
                {
                    clsAllOption option = new clsAllOption();
                    if (!option.ShowSendMail)
                    {
                        this.SendMail("", true);
                    }
                    else
                    {
                        xfmMailContent xfmMailContent = new xfmMailContent(2);
                        xfmMailContent.Sended += delegate (object s, string content, bool attach) {
                            xfmMailContent.Close();
                            this.SendMail(content, attach);
                        };
                        xfmMailContent.ShowDialog();
                    }
                }
            }
            else
            {
                XtraMessageBox.Show("Vui l\x00f2ng kiểm tra lại kết nối với mạng internet!");
            }
        }

        private void calSalaryDebt_EditValueChanged(object sender, EventArgs e)
        {
        }

        private void calSalaryDebt_EditValueChanging(object sender, ChangingEventArgs e)
        {
        }

        private void calSalaryPay_EditValueChanged(object sender, EventArgs e)
        {
        }

        private void calSalaryPay_EditValueChanging(object sender, ChangingEventArgs e)
        {
        }

        public void Clear()
        {
            this.txtID.Text = null;
            this.txtName.Text = null;
            this.imgPhoto.Image = null;
            this.calCoefficientSalary.Text = "";
            this.calBasicSalary.Text = "";
            this.txtWorkHour.Text = "";
            this.calMinusMoney.Text = "";
            this.calAllowance.Text = "";
            this.calWorkSalary.Text = "";
            this.calSocialInsurance.Text = null;
            this.calHealthInsurance.Text = null;
            this.calUnemploymentInsurance.Text = null;
            this.calAdvance.Text = "";
            this.calIncomeTaxMoney.Text = "";
            this.calSalary.Text = "";
            if (this.xucAllowance != null)
            {
                this.xucAllowance.ClearData();
            }
            if (this.xucAdvance != null)
            {
                this.xucAdvance.ClearData();
            }
            if (this.xucSalaryPay != null)
            {
                this.xucSalaryPay.ClearData();
            }
            if (this.xucAssignment != null)
            {
                this.xucAssignment.ClearData();
            }
            if (this.xucSalaryPlus != null)
            {
                this.xucSalaryPlus.ClearData();
            }
            if (this.xucSalaryMinus != null)
            {
                this.xucSalaryMinus.ClearData();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucSalaryCard));
            this.barManager1 = new BarManager(this.components);
            this.bar1 = new Bar();
            this.bbiSave = new BarButtonItem();
            this.bbiPrint = new BarButtonItem();
            this.bbiPrintAllowance = new BarButtonItem();
            this.bbiPrintSalaryPay = new BarButtonItem();
            this.barSubItem1 = new BarSubItem();
            this.bbiPrintAdvance = new BarButtonItem();
            this.bbiPrintAssignment = new BarButtonItem();
            this.bbiPrintSalaryPLus = new BarButtonItem();
            this.bbiPrintSalaryMinus = new BarButtonItem();
            this.bbiSendMail = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.xtraTabControl1 = new XtraTabControl();
            this.tabMain = new XtraTabPage();
            this.groupBox1 = new GroupBox();
            this.calSalary = new CalcEdit();
            this.grSalary = new GroupBox();
            this.labelControl2 = new LabelControl();
            this.calSalaryDebt = new CalcEdit();
            this.labelControl1 = new LabelControl();
            this.calSalaryPay = new CalcEdit();
            this.calIncomeTaxMoney = new CalcEdit();
            this.lcIncomeTaxMoney = new LabelControl();
            this.calAdvance = new CalcEdit();
            this.lcAdvance = new LabelControl();
            this.calUnemploymentInsurance = new CalcEdit();
            this.calHealthInsurance = new CalcEdit();
            this.calSocialInsurance = new CalcEdit();
            this.lcInsurance = new LabelControl();
            this.calWorkSalary = new CalcEdit();
            this.lcTotalSalary = new LabelControl();
            this.calAllowance = new CalcEdit();
            this.lcAllowance = new LabelControl();
            this.lcWorkHour = new LabelControl();
            this.calMinusMoney = new CalcEdit();
            this.lcMinusMoney = new LabelControl();
            this.calBasicSalary = new CalcEdit();
            this.lcBasicSalary = new LabelControl();
            this.calCoefficientSalary = new CalcEdit();
            this.txtWorkHour = new TextEdit();
            this.lcCoefficientSalary = new LabelControl();
            this.imgPhoto = new PictureEdit();
            this.txtName = new TextEdit();
            this.lcEmployee = new LabelControl();
            this.txtID = new TextEdit();
            this.tabAllowance = new XtraTabPage();
            this.tabAdvance = new XtraTabPage();
            this.tabAssignment = new XtraTabPage();
            this.tabSalaryPlus = new XtraTabPage();
            this.tabSalaryMinus = new XtraTabPage();
            this.tabSalaryPay = new XtraTabPage();
            this.barManager1.BeginInit();
            this.imageCollection2.BeginInit();
            this.xtraTabControl1.BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.tabMain.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.calSalary.Properties.BeginInit();
            this.grSalary.SuspendLayout();
            this.calSalaryDebt.Properties.BeginInit();
            this.calSalaryPay.Properties.BeginInit();
            this.calIncomeTaxMoney.Properties.BeginInit();
            this.calAdvance.Properties.BeginInit();
            this.calUnemploymentInsurance.Properties.BeginInit();
            this.calHealthInsurance.Properties.BeginInit();
            this.calSocialInsurance.Properties.BeginInit();
            this.calWorkSalary.Properties.BeginInit();
            this.calAllowance.Properties.BeginInit();
            this.calMinusMoney.Properties.BeginInit();
            this.calBasicSalary.Properties.BeginInit();
            this.calCoefficientSalary.Properties.BeginInit();
            this.txtWorkHour.Properties.BeginInit();
            this.imgPhoto.Properties.BeginInit();
            this.txtName.Properties.BeginInit();
            this.txtID.Properties.BeginInit();
            base.SuspendLayout();
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection2;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiSave, this.bbiPrint, this.bbiSendMail, this.bbiPrintAllowance, this.bbiPrintSalaryPay, this.barSubItem1, this.bbiPrintAdvance, this.bbiPrintAssignment, this.bbiPrintSalaryPLus, this.bbiPrintSalaryMinus });
            this.barManager1.MaxItemId = 10;
            this.bar1.BarName = "Tools";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiSave, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPrint, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPrintAllowance, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPrintSalaryPay, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.barSubItem1, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiSendMail, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Tools";
            this.bbiSave.Caption = "Cập Nhật";
            this.bbiSave.Id = 0;
            this.bbiSave.ImageIndex = 10;
            this.bbiSave.Name = "bbiSave";
            this.bbiSave.ItemClick += new ItemClickEventHandler(this.bbiSave_ItemClick);
            this.bbiPrint.Caption = "In Phiếu Lương";
            this.bbiPrint.Id = 1;
            this.bbiPrint.ImageIndex = 9;
            this.bbiPrint.Name = "bbiPrint";
            this.bbiPrint.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiPrintAllowance.Caption = "In Bảng Phụ Cấp";
            this.bbiPrintAllowance.Id = 3;
            this.bbiPrintAllowance.ImageIndex = 9;
            this.bbiPrintAllowance.Name = "bbiPrintAllowance";
            this.bbiPrintAllowance.ItemClick += new ItemClickEventHandler(this.bbiPrintAllowance_ItemClick);
            this.bbiPrintSalaryPay.Caption = "In Phiếu Thanh To\x00e1n Lương";
            this.bbiPrintSalaryPay.Id = 4;
            this.bbiPrintSalaryPay.ImageIndex = 9;
            this.bbiPrintSalaryPay.Name = "bbiPrintSalaryPay";
            this.bbiPrintSalaryPay.ItemClick += new ItemClickEventHandler(this.bbiPrintSalaryPay_ItemClick);
            this.barSubItem1.Caption = "In Kh\x00e1c";
            this.barSubItem1.Id = 5;
            this.barSubItem1.ImageIndex = 9;
            this.barSubItem1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.bbiPrintAdvance), new LinkPersistInfo(this.bbiPrintAssignment), new LinkPersistInfo(this.bbiPrintSalaryPLus), new LinkPersistInfo(this.bbiPrintSalaryMinus) });
            this.barSubItem1.Name = "barSubItem1";
            this.bbiPrintAdvance.Caption = "Tạm Ứng Lương";
            this.bbiPrintAdvance.Id = 6;
            this.bbiPrintAdvance.Name = "bbiPrintAdvance";
            this.bbiPrintAdvance.ItemClick += new ItemClickEventHandler(this.bbiPrintAdvance_ItemClick);
            this.bbiPrintAssignment.Caption = "C\x00f4ng T\x00e1c Ph\x00ed";
            this.bbiPrintAssignment.Id = 7;
            this.bbiPrintAssignment.Name = "bbiPrintAssignment";
            this.bbiPrintAssignment.ItemClick += new ItemClickEventHandler(this.bbiPrintAssignment_ItemClick);
            this.bbiPrintSalaryPLus.Caption = "C\x00e1c Khoản Thu Nhập Kh\x00e1c";
            this.bbiPrintSalaryPLus.Id = 8;
            this.bbiPrintSalaryPLus.Name = "bbiPrintSalaryPLus";
            this.bbiPrintSalaryPLus.Visibility = BarItemVisibility.Never;
            this.bbiPrintSalaryPLus.ItemClick += new ItemClickEventHandler(this.bbiPrintSalaryPLus_ItemClick);
            this.bbiPrintSalaryMinus.Caption = "C\x00e1c Khoản Khấu Trừ Kh\x00e1c";
            this.bbiPrintSalaryMinus.Id = 9;
            this.bbiPrintSalaryMinus.Name = "bbiPrintSalaryMinus";
            this.bbiPrintSalaryMinus.Visibility = BarItemVisibility.Never;
            this.bbiPrintSalaryMinus.ItemClick += new ItemClickEventHandler(this.bbiPrintSalaryMinus_ItemClick);
            this.bbiSendMail.Caption = "Gửi Mail";
            this.bbiSendMail.Id = 2;
            this.bbiSendMail.ImageIndex = 70;
            this.bbiSendMail.Name = "bbiSendMail";
            this.bbiSendMail.ItemClick += new ItemClickEventHandler(this.bbiSendMail_ItemClick);
            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.imageCollection2.Images.SetKeyName(0x3d, "Vista (35).ico");
            this.imageCollection2.Images.SetKeyName(0x3e, "Security.ico");
            this.imageCollection2.Images.SetKeyName(0x3f, "RibbonPrintPreview_DocumentMapLarge.png");
            this.imageCollection2.Images.SetKeyName(0x40, "11.png");
            this.imageCollection2.Images.SetKeyName(0x41, "Sua.png");
            this.imageCollection2.Images.SetKeyName(0x42, "Them.png");
            this.imageCollection2.Images.SetKeyName(0x43, "PhanQuyen.png");
            this.imageCollection2.Images.SetKeyName(0x44, "11.png");
            this.imageCollection2.Images.SetKeyName(0x45, "plus.png");
            this.imageCollection2.Images.SetKeyName(70, "send.png");
            this.xtraTabControl1.Dock = DockStyle.Fill;
            this.xtraTabControl1.HeaderLocation = TabHeaderLocation.Bottom;
            this.xtraTabControl1.Location = new Point(0, 0x1a);
            this.xtraTabControl1.Name = "xtraTabControl1";
            this.xtraTabControl1.SelectedTabPage = this.tabMain;
            this.xtraTabControl1.Size = new Size(0x3e2, 0x9a);
            this.xtraTabControl1.TabIndex = 4;
            this.xtraTabControl1.TabPages.AddRange(new XtraTabPage[] { this.tabMain, this.tabAllowance, this.tabAdvance, this.tabAssignment, this.tabSalaryPlus, this.tabSalaryMinus, this.tabSalaryPay });
            this.xtraTabControl1.Selected += new TabPageEventHandler(this.xtraTabControl1_Selected);
            this.tabMain.Controls.Add(this.groupBox1);
            this.tabMain.Controls.Add(this.grSalary);
            this.tabMain.Controls.Add(this.calIncomeTaxMoney);
            this.tabMain.Controls.Add(this.lcIncomeTaxMoney);
            this.tabMain.Controls.Add(this.calAdvance);
            this.tabMain.Controls.Add(this.lcAdvance);
            this.tabMain.Controls.Add(this.calUnemploymentInsurance);
            this.tabMain.Controls.Add(this.calHealthInsurance);
            this.tabMain.Controls.Add(this.calSocialInsurance);
            this.tabMain.Controls.Add(this.lcInsurance);
            this.tabMain.Controls.Add(this.calWorkSalary);
            this.tabMain.Controls.Add(this.lcTotalSalary);
            this.tabMain.Controls.Add(this.calAllowance);
            this.tabMain.Controls.Add(this.lcAllowance);
            this.tabMain.Controls.Add(this.lcWorkHour);
            this.tabMain.Controls.Add(this.calMinusMoney);
            this.tabMain.Controls.Add(this.lcMinusMoney);
            this.tabMain.Controls.Add(this.calBasicSalary);
            this.tabMain.Controls.Add(this.lcBasicSalary);
            this.tabMain.Controls.Add(this.calCoefficientSalary);
            this.tabMain.Controls.Add(this.txtWorkHour);
            this.tabMain.Controls.Add(this.lcCoefficientSalary);
            this.tabMain.Controls.Add(this.imgPhoto);
            this.tabMain.Controls.Add(this.txtName);
            this.tabMain.Controls.Add(this.lcEmployee);
            this.tabMain.Controls.Add(this.txtID);
            this.tabMain.Name = "tabMain";
            this.tabMain.Size = new Size(0x3db, 0x7d);
            this.tabMain.Text = "Th\x00f4ng Tin Phiếu Lương";
            this.groupBox1.Controls.Add(this.calSalary);
            this.groupBox1.Location = new Point(820, 3);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x90, 0x37);
            this.groupBox1.TabIndex = 0x41;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Tổng thực l\x00e3nh";
            this.calSalary.Location = new Point(10, 0x15);
            this.calSalary.MenuManager = this.barManager1;
            this.calSalary.Name = "calSalary";
            this.calSalary.Properties.Appearance.Font = new Font("Tahoma", 10f, FontStyle.Bold);
            this.calSalary.Properties.Appearance.ForeColor = Color.FromArgb(0, 0, 0xc0);
            this.calSalary.Properties.Appearance.Options.UseFont = true;
            this.calSalary.Properties.Appearance.Options.UseForeColor = true;
            this.calSalary.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSalary.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calSalary.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calSalary.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSalary.Properties.ReadOnly = true;
            this.calSalary.Size = new Size(0x7d, 0x17);
            this.calSalary.TabIndex = 0x3f;
            this.grSalary.Controls.Add(this.labelControl2);
            this.grSalary.Controls.Add(this.calSalaryDebt);
            this.grSalary.Controls.Add(this.labelControl1);
            this.grSalary.Controls.Add(this.calSalaryPay);
            this.grSalary.Location = new Point(0x1ed, 0x44);
            this.grSalary.Name = "grSalary";
            this.grSalary.Size = new Size(0x1d7, 50);
            this.grSalary.TabIndex = 0x40;
            this.grSalary.TabStop = false;
            this.grSalary.Text = "Thanh to\x00e1n tiền lương";
            this.labelControl2.Location = new Point(0x11b, 0x17);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x33, 13);
            this.labelControl2.TabIndex = 0x45;
            this.labelControl2.Text = "C\x00f2n nợ lại:";
            this.calSalaryDebt.Location = new Point(0x152, 0x12);
            this.calSalaryDebt.MenuManager = this.barManager1;
            this.calSalaryDebt.Name = "calSalaryDebt";
            this.calSalaryDebt.Properties.Appearance.Font = new Font("Tahoma", 10f, FontStyle.Bold);
            this.calSalaryDebt.Properties.Appearance.ForeColor = Color.Red;
            this.calSalaryDebt.Properties.Appearance.Options.UseFont = true;
            this.calSalaryDebt.Properties.Appearance.Options.UseForeColor = true;
            this.calSalaryDebt.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSalaryDebt.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calSalaryDebt.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calSalaryDebt.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSalaryDebt.Properties.ReadOnly = true;
            this.calSalaryDebt.Size = new Size(0x7c, 0x17);
            this.calSalaryDebt.TabIndex = 0x44;
            this.calSalaryDebt.EditValueChanged += new EventHandler(this.calSalaryDebt_EditValueChanged);
            this.calSalaryDebt.EditValueChanging += new ChangingEventHandler(this.calSalaryDebt_EditValueChanging);
            this.labelControl1.Location = new Point(0x4c, 0x17);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x4a, 13);
            this.labelControl1.TabIndex = 0x43;
            this.labelControl1.Text = "Đ\x00e3 thanh to\x00e1n:";
            this.calSalaryPay.Location = new Point(0x9a, 0x13);
            this.calSalaryPay.MenuManager = this.barManager1;
            this.calSalaryPay.Name = "calSalaryPay";
            this.calSalaryPay.Properties.Appearance.Font = new Font("Tahoma", 10f, FontStyle.Bold);
            this.calSalaryPay.Properties.Appearance.ForeColor = Color.Green;
            this.calSalaryPay.Properties.Appearance.Options.UseFont = true;
            this.calSalaryPay.Properties.Appearance.Options.UseForeColor = true;
            this.calSalaryPay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSalaryPay.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calSalaryPay.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calSalaryPay.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSalaryPay.Properties.ReadOnly = true;
            this.calSalaryPay.Size = new Size(120, 0x17);
            this.calSalaryPay.TabIndex = 0x42;
            this.calSalaryPay.EditValueChanged += new EventHandler(this.calSalaryPay_EditValueChanged);
            this.calSalaryPay.EditValueChanging += new ChangingEventHandler(this.calSalaryPay_EditValueChanging);
            this.calIncomeTaxMoney.Location = new Point(0x2d8, 0x24);
            this.calIncomeTaxMoney.MenuManager = this.barManager1;
            this.calIncomeTaxMoney.Name = "calIncomeTaxMoney";
            this.calIncomeTaxMoney.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calIncomeTaxMoney.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calIncomeTaxMoney.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calIncomeTaxMoney.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calIncomeTaxMoney.Properties.ReadOnly = true;
            this.calIncomeTaxMoney.Size = new Size(0x56, 20);
            this.calIncomeTaxMoney.TabIndex = 0x3d;
            this.lcIncomeTaxMoney.Location = new Point(0x27b, 0x27);
            this.lcIncomeTaxMoney.Name = "lcIncomeTaxMoney";
            this.lcIncomeTaxMoney.Size = new Size(0x55, 13);
            this.lcIncomeTaxMoney.TabIndex = 60;
            this.lcIncomeTaxMoney.Text = "Đ\x00f3ng thuế TNCN:";
            this.calAdvance.Location = new Point(0x220, 0x25);
            this.calAdvance.MenuManager = this.barManager1;
            this.calAdvance.Name = "calAdvance";
            this.calAdvance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calAdvance.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calAdvance.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calAdvance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calAdvance.Properties.ReadOnly = true;
            this.calAdvance.Size = new Size(0x56, 20);
            this.calAdvance.TabIndex = 0x3b;
            this.lcAdvance.Location = new Point(0x1ec, 0x27);
            this.lcAdvance.Name = "lcAdvance";
            this.lcAdvance.Size = new Size(0x2e, 13);
            this.lcAdvance.TabIndex = 0x3a;
            this.lcAdvance.Text = "Tạm ứng:";
            this.calUnemploymentInsurance.Location = new Point(0x2d8, 10);
            this.calUnemploymentInsurance.MenuManager = this.barManager1;
            this.calUnemploymentInsurance.Name = "calUnemploymentInsurance";
            this.calUnemploymentInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calUnemploymentInsurance.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calUnemploymentInsurance.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calUnemploymentInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calUnemploymentInsurance.Properties.NullText = "[BHTN]";
            this.calUnemploymentInsurance.Properties.ReadOnly = true;
            this.calUnemploymentInsurance.Size = new Size(0x56, 20);
            this.calUnemploymentInsurance.TabIndex = 0x39;
            this.calHealthInsurance.Location = new Point(0x27c, 10);
            this.calHealthInsurance.MenuManager = this.barManager1;
            this.calHealthInsurance.Name = "calHealthInsurance";
            this.calHealthInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calHealthInsurance.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calHealthInsurance.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calHealthInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calHealthInsurance.Properties.NullText = "[BHYT]";
            this.calHealthInsurance.Properties.ReadOnly = true;
            this.calHealthInsurance.Size = new Size(0x56, 20);
            this.calHealthInsurance.TabIndex = 0x38;
            this.calSocialInsurance.Location = new Point(0x220, 10);
            this.calSocialInsurance.MenuManager = this.barManager1;
            this.calSocialInsurance.Name = "calSocialInsurance";
            this.calSocialInsurance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calSocialInsurance.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calSocialInsurance.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calSocialInsurance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calSocialInsurance.Properties.NullText = "[BHXH]";
            this.calSocialInsurance.Properties.ReadOnly = true;
            this.calSocialInsurance.Size = new Size(0x56, 20);
            this.calSocialInsurance.TabIndex = 0x37;
            this.lcInsurance.Location = new Point(0x1ec, 13);
            this.lcInsurance.Name = "lcInsurance";
            this.lcInsurance.Size = new Size(0x2f, 13);
            this.lcInsurance.TabIndex = 0x36;
            this.lcInsurance.Text = "Bảo hiểm:";
            this.calWorkSalary.Location = new Point(0x166, 0x5d);
            this.calWorkSalary.MenuManager = this.barManager1;
            this.calWorkSalary.Name = "calWorkSalary";
            this.calWorkSalary.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calWorkSalary.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calWorkSalary.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calWorkSalary.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calWorkSalary.Properties.ReadOnly = true;
            this.calWorkSalary.Size = new Size(0x74, 20);
            this.calWorkSalary.TabIndex = 0x35;
            this.lcTotalSalary.Location = new Point(0x126, 0x60);
            this.lcTotalSalary.Name = "lcTotalSalary";
            this.lcTotalSalary.Size = new Size(0x36, 13);
            this.lcTotalSalary.TabIndex = 0x34;
            this.lcTotalSalary.Text = "Tiền lương:";
            this.calAllowance.Location = new Point(0xb5, 0x5d);
            this.calAllowance.MenuManager = this.barManager1;
            this.calAllowance.Name = "calAllowance";
            this.calAllowance.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calAllowance.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calAllowance.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calAllowance.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calAllowance.Properties.ReadOnly = true;
            this.calAllowance.Size = new Size(0x68, 20);
            this.calAllowance.TabIndex = 0x33;
            this.lcAllowance.Location = new Point(0x6c, 0x60);
            this.lcAllowance.Name = "lcAllowance";
            this.lcAllowance.Size = new Size(0x48, 13);
            this.lcAllowance.TabIndex = 50;
            this.lcAllowance.Text = "Phụ cấp lương:";
            this.lcWorkHour.Location = new Point(0x6c, 0x43);
            this.lcWorkHour.Name = "lcWorkHour";
            this.lcWorkHour.Size = new Size(0x3b, 13);
            this.lcWorkHour.TabIndex = 0x31;
            this.lcWorkHour.Text = "Số giờ c\x00f4ng:";
            this.calMinusMoney.Location = new Point(0x153, 0x41);
            this.calMinusMoney.MenuManager = this.barManager1;
            this.calMinusMoney.Name = "calMinusMoney";
            this.calMinusMoney.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calMinusMoney.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calMinusMoney.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calMinusMoney.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calMinusMoney.Properties.ReadOnly = true;
            this.calMinusMoney.Size = new Size(0x87, 20);
            this.calMinusMoney.TabIndex = 0x30;
            this.lcMinusMoney.Location = new Point(0xfd, 0x44);
            this.lcMinusMoney.Name = "lcMinusMoney";
            this.lcMinusMoney.Size = new Size(0x55, 13);
            this.lcMinusMoney.TabIndex = 0x2f;
            this.lcMinusMoney.Text = "Trừ tiền giờ c\x00f4ng:";
            this.calBasicSalary.Location = new Point(0x153, 0x25);
            this.calBasicSalary.MenuManager = this.barManager1;
            this.calBasicSalary.Name = "calBasicSalary";
            this.calBasicSalary.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calBasicSalary.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calBasicSalary.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calBasicSalary.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calBasicSalary.Properties.ReadOnly = true;
            this.calBasicSalary.Size = new Size(0x87, 20);
            this.calBasicSalary.TabIndex = 0x2e;
            this.lcBasicSalary.Location = new Point(0x103, 40);
            this.lcBasicSalary.Name = "lcBasicSalary";
            this.lcBasicSalary.Size = new Size(0x4b, 13);
            this.lcBasicSalary.TabIndex = 0x2d;
            this.lcBasicSalary.Text = "Lương căn bản:";
            this.calCoefficientSalary.Location = new Point(0xb5, 0x26);
            this.calCoefficientSalary.MenuManager = this.barManager1;
            this.calCoefficientSalary.Name = "calCoefficientSalary";
            this.calCoefficientSalary.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calCoefficientSalary.Properties.DisplayFormat.FormatString = "{0:##,##0}";
            this.calCoefficientSalary.Properties.EditFormat.FormatString = "{0:##,##0}";
            this.calCoefficientSalary.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calCoefficientSalary.Properties.ReadOnly = true;
            this.calCoefficientSalary.Size = new Size(0x45, 20);
            this.calCoefficientSalary.TabIndex = 0x2c;
            this.txtWorkHour.Location = new Point(0xb5, 0x41);
            this.txtWorkHour.MenuManager = this.barManager1;
            this.txtWorkHour.Name = "txtWorkHour";
            this.txtWorkHour.Properties.ReadOnly = true;
            this.txtWorkHour.Size = new Size(0x45, 20);
            this.txtWorkHour.TabIndex = 0x1d;
            this.lcCoefficientSalary.Location = new Point(0x6c, 40);
            this.lcCoefficientSalary.Name = "lcCoefficientSalary";
            this.lcCoefficientSalary.Size = new Size(0x3d, 13);
            this.lcCoefficientSalary.TabIndex = 0x1c;
            this.lcCoefficientSalary.Text = "Hệ số lương:";
            this.imgPhoto.Location = new Point(6, 12);
            this.imgPhoto.MenuManager = this.barManager1;
            this.imgPhoto.Name = "imgPhoto";
            this.imgPhoto.Properties.NullText = "[Chưa c\x00f3 h\x00ecnh]";
            this.imgPhoto.Properties.ReadOnly = true;
            this.imgPhoto.Properties.SizeMode = PictureSizeMode.Zoom;
            this.imgPhoto.Size = new Size(0x60, 0x62);
            this.imgPhoto.TabIndex = 0x16;
            this.txtName.EditValue = "[T\x00ean nh\x00e2n vi\x00ean]";
            this.txtName.Location = new Point(0x123, 11);
            this.txtName.MenuManager = this.barManager1;
            this.txtName.Name = "txtName";
            this.txtName.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.txtName.Properties.Appearance.Options.UseFont = true;
            this.txtName.Properties.ReadOnly = true;
            this.txtName.Size = new Size(0xb7, 20);
            this.txtName.TabIndex = 0x1a;
            this.lcEmployee.Location = new Point(0x6c, 14);
            this.lcEmployee.Name = "lcEmployee";
            this.lcEmployee.Size = new Size(0x34, 13);
            this.lcEmployee.TabIndex = 0x17;
            this.lcEmployee.Text = "Nh\x00e2n vi\x00ean:";
            this.txtID.EditValue = "[M\x00e3 nh\x00e2n vi\x00ean]";
            this.txtID.Location = new Point(0xb5, 11);
            this.txtID.MenuManager = this.barManager1;
            this.txtID.Name = "txtID";
            this.txtID.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.txtID.Properties.Appearance.Options.UseFont = true;
            this.txtID.Properties.ReadOnly = true;
            this.txtID.Size = new Size(0x68, 20);
            this.txtID.TabIndex = 0x18;
            this.tabAllowance.Name = "tabAllowance";
            this.tabAllowance.Size = new Size(0x3db, 0x7d);
            this.tabAllowance.Text = "(+) C\x00e1c Loại Phụ Cấp";
            this.tabAdvance.Name = "tabAdvance";
            this.tabAdvance.Size = new Size(0x3db, 0x7d);
            this.tabAdvance.Text = "(-) Tạm Ứng Lương";
            this.tabAssignment.Name = "tabAssignment";
            this.tabAssignment.Size = new Size(0x3db, 0x7d);
            this.tabAssignment.Text = "(+) C\x00f4ng T\x00e1c Ph\x00ed";
            this.tabSalaryPlus.Name = "tabSalaryPlus";
            this.tabSalaryPlus.Size = new Size(0x3db, 0x7d);
            this.tabSalaryPlus.Text = "(+) C\x00e1c Khoản Thu Nhập Kh\x00e1c";
            this.tabSalaryMinus.Name = "tabSalaryMinus";
            this.tabSalaryMinus.Size = new Size(0x3db, 0x7d);
            this.tabSalaryMinus.Text = "(-) C\x00e1c Khoản Khấu Trừ Kh\x00e1c";
            this.tabSalaryPay.Name = "tabSalaryPay";
            this.tabSalaryPay.Size = new Size(0x3db, 0x7d);
            this.tabSalaryPay.Text = "(-) Thanh To\x00e1n Lương";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.xtraTabControl1);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xucSalaryCard";
            base.Size = new Size(0x3e2, 180);
            this.barManager1.EndInit();
            this.imageCollection2.EndInit();
            this.xtraTabControl1.EndInit();
            this.xtraTabControl1.ResumeLayout(false);
            this.tabMain.ResumeLayout(false);
            this.tabMain.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.calSalary.Properties.EndInit();
            this.grSalary.ResumeLayout(false);
            this.grSalary.PerformLayout();
            this.calSalaryDebt.Properties.EndInit();
            this.calSalaryPay.Properties.EndInit();
            this.calIncomeTaxMoney.Properties.EndInit();
            this.calAdvance.Properties.EndInit();
            this.calUnemploymentInsurance.Properties.EndInit();
            this.calHealthInsurance.Properties.EndInit();
            this.calSocialInsurance.Properties.EndInit();
            this.calWorkSalary.Properties.EndInit();
            this.calAllowance.Properties.EndInit();
            this.calMinusMoney.Properties.EndInit();
            this.calBasicSalary.Properties.EndInit();
            this.calCoefficientSalary.Properties.EndInit();
            this.txtWorkHour.Properties.EndInit();
            this.imgPhoto.Properties.EndInit();
            this.txtName.Properties.EndInit();
            this.txtID.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            this.bbiSave.Caption = MultiLanguages.GetString("tbl_SalaryCard", "Save", this.bbiSave.Caption);
            this.bbiPrint.Caption = MultiLanguages.GetString("tbl_SalaryCard", "Print", this.bbiPrint.Caption);
            this.bbiPrintAllowance.Caption = MultiLanguages.GetString("tbl_SalaryCard", "PrintAllowance", this.bbiPrintAllowance.Caption);
            this.bbiSendMail.Caption = MultiLanguages.GetString("tbl_SalaryCard", "SendMail", this.bbiSendMail.Caption);
            this.tabMain.Text = MultiLanguages.GetString("tbl_SalaryCard", "tabMain", this.tabMain.Text);
            this.tabAllowance.Text = MultiLanguages.GetString("tbl_SalaryCard", "tabAllowance", this.tabAllowance.Text);
            this.tabAdvance.Text = MultiLanguages.GetString("tbl_SalaryCard", "tabAdvance", this.tabAdvance.Text);
            this.tabAssignment.Text = MultiLanguages.GetString("tbl_SalaryCard", "tabAssignment", this.tabAssignment.Text);
            this.tabSalaryPlus.Text = MultiLanguages.GetString("tbl_SalaryCard", "tabSalaryPlus", this.tabSalaryPlus.Text);
            this.tabSalaryMinus.Text = MultiLanguages.GetString("tbl_SalaryCard", "tabSalaryMinus", this.tabSalaryMinus.Text);
            this.grSalary.Text = MultiLanguages.GetString("tbl_SalaryCard", "grSalary", this.grSalary.Text);
            this.imgPhoto.Properties.NullText = MultiLanguages.GetString("tbl_SalaryCard", "NoPhoto", this.imgPhoto.Properties.NullText);
            this.lcEmployee.Text = MultiLanguages.GetString("tbl_SalaryCard", "Employee", this.lcEmployee.Text);
            this.lcCoefficientSalary.Text = MultiLanguages.GetString("tbl_SalaryCard", "CoefficientSalary", this.lcCoefficientSalary.Text);
            this.lcBasicSalary.Text = MultiLanguages.GetString("tbl_SalaryCard", "BasicSalary", this.lcBasicSalary.Text);
            this.lcWorkHour.Text = MultiLanguages.GetString("tbl_SalaryCard", "WorkHour", this.lcWorkHour.Text);
            this.lcMinusMoney.Text = MultiLanguages.GetString("tbl_SalaryCard", "MinusMoney", this.lcMinusMoney.Text);
            this.lcAllowance.Text = MultiLanguages.GetString("tbl_SalaryCard", "Allowance", this.lcAllowance.Text);
            this.lcTotalSalary.Text = MultiLanguages.GetString("tbl_SalaryCard", "TotalSalary", this.lcTotalSalary.Text);
            this.lcInsurance.Text = MultiLanguages.GetString("tbl_SalaryCard", "Insurance", this.lcInsurance.Text);
            this.lcIncomeTaxMoney.Text = MultiLanguages.GetString("tbl_SalaryCard", "IncomeTaxMoney", this.lcIncomeTaxMoney.Text);
            this.lcAdvance.Text = MultiLanguages.GetString("tbl_SalaryCard", "Advance", this.lcAdvance.Text);
        }

        private string LoadMailContent()
        {
            try
            {
                DataSet set = new DataSet();
                set.ReadXml(Application.StartupPath + @"\Layout\sendMailSalary.xml");
                return set.Tables[0].Rows[0][0].ToString();
            }
            catch
            {
                return "Ch\x00e0o [Giới t\x00ednh] [Họ l\x00f3t] [T\x00ean] th\x00e2n mến![Xuống d\x00f2ng]Hiện tại phiếu t\x00ednh lương th\x00e1ng [Th\x00e1ng]/[Năm] đ\x00e3 c\x00f3. Anh c\x00f3 thể download file k\x00e8m theo dưới đ\x00e2y để tham khảo. Nếu c\x00f3 g\x00ec thắc mắc cần được giải đ\x00e1p, Anh c\x00f3 thể phản hồi trở lại bằng địa chỉ email n\x00e0y.[Xuống d\x00f2ng]Th\x00e2n ch\x00e0o! Ch\x00fac vui vẻ!";
            }
        }

        public void Lock(bool IsLock)
        {
            if (IsLock)
            {
                this.bbiSave.Enabled = false;
            }
            else
            {
                this.bbiSave.Enabled = true;
            }
        }

        private void RaiseUpdatedHander()
        {
            if (this.Updated != null)
            {
                this.Updated(this);
            }
        }

        private void SendMail(string Content, bool Attach)
        {
            if (Content == "")
            {
                Content = this.LoadMailContent();
            }
            if (this.l_Employee.Email == "")
            {
                XtraMessageBox.Show("Chưa thiết lập địa chỉ email cho nh\x00e2n vi\x00ean n\x00e0y!");
            }
            else
            {
                rptSalary2 rpt = new rptSalary2(this.m_Month, this.m_Year, this.m_EmployeeCode);
                SendReportMail mail = new SendReportMail();
                string newValue = "";
                if (this.l_Employee.Sex)
                {
                    newValue = "Anh";
                }
                else
                {
                    newValue = "Chị";
                }
                string content = Content;
                content = content.Replace("[M\x00e3 nh\x00e2n vi\x00ean]", this.m_EmployeeCode).Replace("[Họ l\x00f3t]", this.l_Employee.FirstName).Replace("[T\x00ean]", this.l_Employee.LastName).Replace("[Ng\x00e0y sinh]", this.l_Employee.BirthdayDay.ToString() + "/" + this.l_Employee.BirthdayMonth.ToString() + "/" + this.l_Employee.BirthdayYear.ToString()).Replace("[Giới t\x00ednh]", newValue).Replace("[Nơi sinh]", this.l_Employee.BirthPlace).Replace("[Địa chỉ]", this.l_Employee.MainAddress).Replace("[Tạm tr\x00fa]", this.l_Employee.ContactAddress).Replace("[CMND]", this.l_Employee.IDCard).Replace("[Email]", this.l_Employee.Email).Replace("[Điện thoại]", this.l_Employee.CellPhone).Replace("[Chức vụ]", this.l_Employee.Position).Replace("[Chi nh\x00e1nh]", this.l_Employee.BranchName).Replace("[Ph\x00f2ng ban]", this.l_Employee.DepartmentName).Replace("[Tổ nh\x00f3m]", this.l_Employee.GroupName).Replace("[Lương căn bản]", this.l_Employee.BasicSalary.ToString("#,0")).Replace("[Th\x00e1ng]", this.m_Month.ToString()).Replace("[Năm]", this.m_Year.ToString()).Replace("[Xuống d\x00f2ng]", "<br/>");
                mail.Send(this.l_Employee.Email, MyLogin.Account + " - " + "" , //MyInfo.Company, 
                  "Phiếu Lương Th\x00e1ng " + this.m_Month.ToString() + "/" + this.m_Year.ToString(), content, rpt, this.l_Employee.EmployeeCode + "_" + this.m_Month.ToString() + this.m_Year.ToString(), Attach);
            }
        }

        public void SetData(Guid SalaryTableListID, string EmployeeCode, int Month, int Year)
        {
            this.m_SalaryTableListID = SalaryTableListID;
            this.m_EmployeeCode = EmployeeCode;
            this.m_Month = Month;
            this.m_Year = Year;
            this.l_Employee.Get(this.m_EmployeeCode);
            this.txtID.Text = this.m_EmployeeCode = this.l_Employee.EmployeeCode;
            this.txtName.Text = this.l_Employee.FirstName.ToString() + " " + this.l_Employee.LastName.ToString();
            this.imgPhoto.Image = this.l_Employee.Photo;
            HRM_SALARY hrm_salary = new HRM_SALARY();
            hrm_salary.Get(SalaryTableListID, EmployeeCode);
            this.calCoefficientSalary.EditValue = hrm_salary.CoefficientSalary;
            this.calBasicSalary.EditValue = hrm_salary.BasicSalary;
            this.txtWorkHour.Text = hrm_salary.WorkHour.ToString();
            this.calMinusMoney.EditValue = hrm_salary.MinusLateEarly + hrm_salary.MinusMoney;
            this.calAllowance.EditValue = hrm_salary.Allowance;
            this.calWorkSalary.EditValue = hrm_salary.WorkSalary;
            this.calSocialInsurance.EditValue = hrm_salary.SocialInsurance;
            this.calHealthInsurance.EditValue = hrm_salary.HealthInsurance;
            this.calUnemploymentInsurance.EditValue = hrm_salary.UnemploymentInsurance;
            this.calAdvance.EditValue = hrm_salary.Advance;
            this.calIncomeTaxMoney.EditValue = hrm_salary.IncomeTaxMoney;
            this.calSalary.EditValue = hrm_salary.Salary;
            this.calSalaryPay.EditValue = hrm_salary.SalaryPay;
            this.calSalaryDebt.EditValue = hrm_salary.SalaryDebt;
            if (this.xucAllowance != null)
            {
                this.xucAllowance.Init(this.m_SalaryTableListID, this.m_EmployeeCode);
            }
            if (this.xucAdvance != null)
            {
                this.xucAdvance.Init(this.m_EmployeeCode, this.m_Month, this.m_Year);
            }
            if (this.xucSalaryPay != null)
            {
                this.xucSalaryPay.Init(this.m_SalaryTableListID, this.m_EmployeeCode);
            }
            if (this.xucAssignment != null)
            {
                this.xucAssignment.Init(this.m_EmployeeCode, this.m_Month, this.m_Year);
            }
            if (this.xucSalaryMinus != null)
            {
                this.xucSalaryMinus.Init(this.m_SalaryTableListID, this.m_EmployeeCode);
            }
            if (this.xucSalaryPlus != null)
            {
                this.xucSalaryPlus.Init(this.m_SalaryTableListID, this.m_EmployeeCode);
            }
        }

        private void xtraTabControl1_Selected(object sender, TabPageEventArgs e)
        {
            if (e.Page == this.tabAllowance)
            {
                if (this.xucAllowance == null)
                {
                    this.xucAllowance = new xucAllowance1(this.m_SalaryTableListID, this.m_EmployeeCode);
                    this.xucAllowance.Dock = DockStyle.Fill;
                    this.tabAllowance.Controls.Add(this.xucAllowance);
                }
            }
            else if (e.Page == this.tabAdvance)
            {
                if (this.xucAdvance == null)
                {
                    this.xucAdvance = new xucAdvance1(this.m_EmployeeCode, this.m_Month, this.m_Year);
                    this.xucAdvance.Dock = DockStyle.Fill;
                    this.tabAdvance.Controls.Add(this.xucAdvance);
                }
            }
            else if (e.Page == this.tabSalaryPay)
            {
                if (this.xucSalaryPay == null)
                {
                    this.xucSalaryPay = new xucSalaryPay1(this.m_SalaryTableListID, this.m_EmployeeCode);
                    this.xucSalaryPay.Dock = DockStyle.Fill;
                    this.tabSalaryPay.Controls.Add(this.xucSalaryPay);
                }
            }
            else if (e.Page == this.tabAssignment)
            {
                if (this.xucAssignment == null)
                {
                    this.xucAssignment = new xucAssignment1(this.m_EmployeeCode, this.m_Month, this.m_Year);
                    this.xucAssignment.Dock = DockStyle.Fill;
                    this.tabAssignment.Controls.Add(this.xucAssignment);
                }
            }
            else if (e.Page == this.tabSalaryPlus)
            {
                if (this.xucSalaryPlus == null)
                {
                    this.xucSalaryPlus = new HRM.CORE.xucSalaryPlus(this.m_SalaryTableListID, this.m_EmployeeCode);
                    this.xucSalaryPlus.Dock = DockStyle.Fill;
                    this.tabSalaryPlus.Controls.Add(this.xucSalaryPlus);
                }
            }
            else if ((e.Page == this.tabSalaryMinus) && (this.xucSalaryMinus == null))
            {
                this.xucSalaryMinus = new HRM.CORE.xucSalaryMinus(this.m_SalaryTableListID, this.m_EmployeeCode);
                this.xucSalaryMinus.Dock = DockStyle.Fill;
                this.tabSalaryMinus.Controls.Add(this.xucSalaryMinus);
            }
        }

        public delegate void UpdatedHandler(object sender);
    }
}

